home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 77 / 077.d81 / hi source (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  669 lines

  1. 5 open4,4,7
  2. 10 sys700
  3. 20 .opt p4
  4. 30 *= $c700
  5. 40 ffd2 =$ffd2
  6. 50 getin =$ffe4
  7. 60 base =$a000
  8. 70 jmp start
  9. 80 lcount =*
  10. 90 .byte 0:eof =*:.byte 0,0
  11. 100 temp =*
  12. 110 .byte 0
  13. 120 col =*
  14. 130 .byte 3
  15. 140 fade =*
  16. 150 .byte 15,15,12,11,0
  17. 160 pretty =*
  18. 170 .byte 0,0
  19. 180 menu =*
  20. 190 .asc "[195][210][211][210] up/down [159]page [195][159] color [209][159] exit":.byte 0
  21. 200 prlen =*:.byte 0,0
  22. 210 prloc =*:.byte 0,0
  23. 220 page =*:.byte 0
  24. 230 curpage =*:.byte 0
  25. 240 border =*:.byte 0
  26. 250 backgr =*:.byte 0
  27. 260 start jsr $aefd
  28. 270 jsr $ad9e
  29. 280 jsr $b6a3
  30. 290 ldx $22
  31. 300 ldy $23
  32. 310 jsr $ffbd        
  33. 320 loadfile lda #1
  34. 330 ldx #8
  35. 340 ldy #0
  36. 350 jsr $ffba
  37. 360 lda #0
  38. 370 ldx #<base
  39. 380 ldy #>base
  40. 390 jsr $ffd5
  41. 400 stx eof
  42. 410 sty eof+1
  43. 420 storzero stx 251
  44. 430 sty 252
  45. 440 ldy #0
  46. 450 tya
  47. 460 sta (251),y
  48. 470 lda 53280
  49. 480 sta border
  50. 490 lda 53281
  51. 500 sta backgr
  52. 510 ldy #0
  53. 520 sty 53280
  54. 530 sty 53281
  55. 540 jsr $aefd
  56. 550 jsr $ad9e
  57. 560 jsr $b6a3
  58. 570 ldx $22:stx prloc
  59. 580 ldy $23:sty prloc+1
  60. 590 ldx #23
  61. 600 sta prlen
  62. 610 lsr
  63. 620 sta prlen+1
  64. 630 lda #20
  65. 640 sec
  66. 650 sbc prlen+1
  67. 660 sta prlen+1
  68. 670 jsr figureit
  69. 680 lda 1
  70. 690 ora #1
  71. 700 sta 1
  72. 710 jsr videoin
  73. 720 lda #"[147]"
  74. 730 jsr $ffd2
  75. 740 lda #1
  76. 750 sta 646
  77. 760 lda #"[162]"
  78. 770 ldy #39
  79. 780 topline jsr $ffd2
  80. 790 dey
  81. 800 bpl topline
  82. 810 lda #3
  83. 820 sta 199
  84. 830 sta 646
  85. 840 lda #32
  86. 850 ldy #119
  87. 860 line2 jsr $ffd2
  88. 870 dey
  89. 880 bpl line2
  90. 890 lda #0
  91. 900 sta curpage
  92. 910 sta 199
  93. 920 lda #11
  94. 930 sta 646
  95. 940 lda #"[184]"
  96. 950 ldy #39
  97. 960 line3 jsr $ffd2
  98. 970 dey
  99. 980 bpl line3
  100. 990 lda #6
  101. 1000 sta 646
  102. 1010 lda #"[176]"
  103. 1020 jsr $ffd2
  104. 1030 ldy #37
  105. 1040 lda #"[192]"
  106. 1050 sigh jsr $ffd2
  107. 1060 dey
  108. 1070 bpl sigh
  109. 1080 lda #"[174]"
  110. 1090 jsr $ffd2
  111. 1100 ldx #15
  112. 1110 mainarea ldy #37
  113. 1120 lda #"[221]"
  114. 1130 jsr $ffd2
  115. 1140 lda #3
  116. 1150 sta 646
  117. 1160 lda #32
  118. 1170 ma1 jsr $ffd2
  119. 1180 dey
  120. 1190 bpl ma1
  121. 1200 lda #6
  122. 1210 sta 646
  123. 1220 lda #"[221]"
  124. 1230 jsr $ffd2
  125. 1240 dex
  126. 1250 bpl mainarea
  127. 1260 lda #"[173]"
  128. 1270 jsr $ffd2
  129. 1280 lda #"[192]"
  130. 1290 ldy #37
  131. 1300 ma3 jsr $ffd2
  132. 1310 dey
  133. 1320 bpl ma3
  134. 1330 lda #"[189]"
  135. 1340 jsr $ffd2
  136. 1350 links ldy #25
  137. 1360 linelink lda 217,y
  138. 1370 ora #128
  139. 1380 sta 217,y
  140. 1390 dey
  141. 1400 bpl linelink
  142. 1410 stx 251
  143. 1420 sty 252
  144. 1430 ldy #3:ldx #23
  145. 1440 clc
  146. 1450 jsr $fff0
  147. 1460 ldy #0
  148. 1470 smenu lda menu,y
  149. 1480 beq spretty
  150. 1490 jsr $ffd2
  151. 1500 iny
  152. 1510 jmp smenu
  153. 1520 spretty ldx #3
  154. 1530 stx 199
  155. 1540 stx 646
  156. 1550 ldx #2
  157. 1560 ldy prlen+1
  158. 1570 clc:jsr $fff0
  159. 1580 lda prloc
  160. 1590 sta 251
  161. 1600 lda prloc+1
  162. 1610 sta 252
  163. 1620 ldy #0
  164. 1630 showpret lda (251),y
  165. 1640 jsr $ffd2
  166. 1650 iny
  167. 1660 cpy prlen
  168. 1670 bne showpret
  169. 1680 main lda #<base
  170. 1690 sta 251
  171. 1700 lda #>base
  172. 1710 sta 252
  173. 1720 showpage ldx #6
  174. 1730 ldy #1
  175. 1740 clc
  176. 1750 jsr $fff0
  177. 1760 lda #0
  178. 1770 sta 646
  179. 1780 ldy #0
  180. 1790 sty lcount
  181. 1800 sty 199
  182. 1810 getit lda 1
  183. 1820 and #254
  184. 1830 sta 1
  185. 1840 sei
  186. 1850 getdata lda (251),y
  187. 1860 beq interupt
  188. 1870 cmp #13
  189. 1880 beq its13
  190. 1890 jmp print
  191. 1900 its13 jsr carriage
  192. 1910 lda lcount
  193. 1920 cmp #16
  194. 1930 bne getdata
  195. 1940 interupt cli
  196. 1950 lda 1
  197. 1960 ora #1
  198. 1970 sta 1
  199. 1980 jsr fadein
  200. 1990 jsr prinpage
  201. 2000 scankey jsr getin
  202. 2010 cmp #0
  203. 2020 beq scankey
  204. 2030 cmp #""
  205. 2040 bne cup
  206. 2050 jsr flipup
  207. 2060 jsr fadeout
  208. 2070 jmp showpage
  209. 2080 cup cmp #"[145]"
  210. 2090 bne chcol
  211. 2100 jsr flipdown
  212. 2110 jsr fadeout
  213. 2120 jmp showpage
  214. 2130 chcol cmp #"c"
  215. 2140 bne chhome
  216. 2150 jsr color
  217. 2160 jmp scankey
  218. 2170 chhome cmp #""
  219. 2180 bne chshift
  220. 2190 jsr fadeout
  221. 2200 lda #1
  222. 2210 sta curpage:jsr flipdown
  223. 2220 jmp showpage
  224. 2230 chshift cmp #"[147]"
  225. 2240 bne chquit
  226. 2250 ldx page
  227. 2260 stx curpage
  228. 2270 jsr fadeout
  229. 2280 jsr flipup
  230. 2290 jmp showpage
  231. 2300 chquit cmp #"q"
  232. 2310 bne chprt
  233. 2320 jmp quit
  234. 2330 chprt cmp #"p"
  235. 2340 bne ahwell
  236. 2350 jsr prompt
  237. 2360 jsr clear
  238. 2370 jmp links
  239. 2380 ahwell jmp scankey
  240. 2390 print jsr $ffd2
  241. 2400 jsr bump
  242. 2410 jmp getit
  243. 2420 quit lda 1
  244. 2430 ora #1
  245. 2440 sta 1
  246. 2450 jsr videoout
  247. 2460 rts
  248. 2470 carriage jsr $ffd2
  249. 2480 lda #""
  250. 2490 jsr bump
  251. 2500 jsr $ffd2
  252. 2510 inc lcount
  253. 2520 rts
  254. 2530 color inc col
  255. 2540 lda col
  256. 2550 and #15
  257. 2560 sta col:sta 646
  258. 2570 cmp #0
  259. 2580 beq color
  260. 2590 cwait lda 53265
  261. 2600 bpl cwait
  262. 2610 ldy #37
  263. 2620 lda col
  264. 2630 wcolor sta 1265+54272,y
  265. 2640 sta 1305+54272,y
  266. 2650 sta 1345+54272,y
  267. 2660 sta 1385+54272,y
  268. 2670 sta 1425+54272,y
  269. 2680 sta 1465+54272,y
  270. 2690 sta 1505+54272,y
  271. 2700 sta 1545+54272,y
  272. 2710 sta 1585+54272,y
  273. 2720 sta 1625+54272,y
  274. 2730 sta 1665+54272,y
  275. 2740 sta 1705+54272,y
  276. 2750 sta 1745+54272,y
  277. 2760 sta 1785+54272,y
  278. 2770 sta 1825+54272,y
  279. 2780 sta 1865+54272,y
  280. 2790 dey
  281. 2800 bpl wcolor
  282. 2810 rts
  283. 2820 bump inc 251
  284. 2830 beq bump2
  285. 2840 rts
  286. 2850 bump2 inc 252
  287. 2860 rts
  288. 2870 clear lda 53265
  289. 2880 bpl clear
  290. 2890 ldy #37
  291. 2900 lda #32
  292. 2910 wipe sta 1265,y
  293. 2920 sta 1305,y
  294. 2930 sta 1345,y
  295. 2940 sta 1385,y
  296. 2950 sta 1425,y
  297. 2960 sta 1465,y
  298. 2970 sta 1505,y
  299. 2980 sta 1545,y
  300. 2990 sta 1585,y
  301. 3000 sta 1625,y
  302. 3010 sta 1665,y
  303. 3020 sta 1705,y
  304. 3030 sta 1745,y
  305. 3040 sta 1785,y
  306. 3050 sta 1825,y
  307. 3060 sta 1865,y
  308. 3070 dey
  309. 3080 bpl wipe
  310. 3090 rts
  311. 3100 figureit lda 1
  312. 3110 and #254
  313. 3120 sta 1
  314. 3130 lda #<base
  315. 3140 sta 251:sta ptable
  316. 3150 lda #>base
  317. 3160 sta 252:sta ptable+1
  318. 3170 ldy #0
  319. 3180 ldx #0
  320. 3190 stx page
  321. 3200 apage lda (251),y
  322. 3210 bne ckrt
  323. 3220 rts
  324. 3230 ckrt cmp #13
  325. 3240 bne incpage
  326. 3250 jsr found
  327. 3260 incpage inc 251
  328. 3270 beq bpage
  329. 3280 jmp apage
  330. 3290 bpage inc 252
  331. 3300 jmp apage
  332. 3310 found inx
  333. 3320 cpx #15
  334. 3330 bne foundout
  335. 3340 ldx #0
  336. 3350 inc page
  337. 3360 inc 251
  338. 3370 bne cpage
  339. 3380 inc 252
  340. 3390 cpage lda page
  341. 3400 asl
  342. 3410 tax
  343. 3420 lda 251
  344. 3430 sta ptable,x
  345. 3440 lda 252
  346. 3450 inx
  347. 3460 sta ptable,x
  348. 3470 ldx #0
  349. 3480 foundout rts
  350. 3490 flipup lda curpage
  351. 3500 cmp page
  352. 3510 bne ghead
  353. 3520 jmp chpage
  354. 3530 ghead inc curpage
  355. 3540 chpage lda curpage
  356. 3550 asl
  357. 3560 tax
  358. 3570 lda ptable,x
  359. 3580 sta 251
  360. 3590 inx
  361. 3600 lda ptable,x
  362. 3610 sta 252
  363. 3620 rts
  364. 3630 flipdown lda curpage
  365. 3640 bne sokay
  366. 3650 jmp chpage
  367. 3660 sokay dec curpage
  368. 3670 jmp chpage
  369. 3680 fadeout lda col
  370. 3690 sta temp
  371. 3700 sei
  372. 3710 ldx #0
  373. 3720 floop lda fade,x
  374. 3730 sta col
  375. 3740 jsr cwait
  376. 3750 inx
  377. 3760 cpx #5
  378. 3770 bne floop
  379. 3780 fout jsr clear
  380. 3790 lda temp
  381. 3800 sta col
  382. 3810 cli:rts
  383. 3820 fadein lda col
  384. 3830 sta temp
  385. 3840 ldx #5
  386. 3850 sei
  387. 3860 filoop lda fade,x
  388. 3870 sta col
  389. 3880 jsr cwait
  390. 3890 dex
  391. 3900 bne filoop
  392. 3910 lda temp
  393. 3920 sta col
  394. 3930 jsr cwait
  395. 3940 cli:rts
  396. 3950 prinpage ldx #24
  397. 3960 ldy #17
  398. 3970 clc
  399. 3980 jsr $fff0
  400. 3990 lda #12
  401. 4000 sta 646
  402. 4010 ldx curpage
  403. 4020 inx
  404. 4030 lda #0
  405. 4040 sta 199
  406. 4050 clc            
  407. 4060 jsr $bdcd
  408. 4070 lda #" "
  409. 4080 jsr $ffd2
  410. 4090 lda #"o"
  411. 4100 jsr $ffd2
  412. 4110 lda #"f"
  413. 4120 jsr $ffd2
  414. 4130 lda #" "
  415. 4140 jsr $ffd2
  416. 4150 lda #0
  417. 4160 ldx page
  418. 4170 inx
  419. 4180 jsr $bdcd
  420. 4190 lda #" "
  421. 4200 jsr $ffd2
  422. 4210 lda #"[145]"
  423. 4220 jmp $ffd2
  424. 4230 videoin lda #0
  425. 4240 sta 251
  426. 4250 sta 253
  427. 4260 lda #>1024
  428. 4270 sta 252
  429. 4280 lda #>$e000
  430. 4290 sta 254
  431. 4300 jsr copy
  432. 4310 lda #>$d800
  433. 4320 sta 252
  434. 4330 lda #>$e400
  435. 4340 sta 254
  436. 4350 jsr copy
  437. 4360 rts
  438. 4370 videoout lda #0
  439. 4380 sta 251
  440. 4390 sta 253
  441. 4400 lda #>$e000
  442. 4410 sta 252
  443. 4420 lda #>$0400
  444. 4430 sta 254
  445. 4440 jsr copy
  446. 4450 lda #>$e400
  447. 4460 sta 252
  448. 4470 lda #>$d800
  449. 4480 sta 254
  450. 4490 jsr copy
  451. 4500 lda border
  452. 4510 sta 53280
  453. 4520 lda backgr
  454. 4530 sta 53281
  455. 4540 rts
  456. 4550 copy ldx #3
  457. 4560 ldy #0
  458. 4570 sei
  459. 4580 lda 1
  460. 4590 and #253
  461. 4600 sta 1
  462. 4610 copya lda (251),y
  463. 4620 sta (253),y
  464. 4630 iny
  465. 4640 bne copya
  466. 4650 inc 252
  467. 4660 inc 254
  468. 4670 dex
  469. 4680 bpl copya
  470. 4690 lda 1
  471. 4700 ora #2
  472. 4710 sta 1
  473. 4720 cli
  474. 4730 rts
  475. 4740 printout jsr openptr
  476. 4750 lda #4
  477. 4760 jsr $ffc3 ;close file
  478. 4770 jsr $ffb7  ;readst
  479. 4780 bpl (NULL)ahead
  480. 4790 flash inc 53281
  481. 4800 lda 197
  482. 4810 cmp #64
  483. 4820 bne flash
  484. 4830 lda #0
  485. 4840 sta 53281
  486. 4850 rts
  487. 4860 (NULL)ahead jsr openptr
  488. 4870 ldx #4    ; file number
  489. 4880 jsr $ffc9 ; output to file #4
  490. 4890 lda #1
  491. 4900 sta pos
  492. 4910 sta wordlen
  493. 4920 sta endpflag
  494. 4930 sta retcount
  495. 4940 inc retcount
  496. 4950 lda #" "
  497. 4960 ldx #4
  498. 4970 stx line
  499. 4980 jsr repeat
  500. 4990 jsr leftmrgn ;position printer
  501. 5000 jsr setprt
  502. 5010 here(NULL)es jsr findword ;find a word
  503. 5020 jsr printwrd ;print the word
  504. 5030 jsr advcntr ;advance hi/lo pointer
  505. 5040 ldx 197
  506. 5050 cpx #10
  507. 5060 beq formfeed
  508. 5070 ldx endpflag
  509. 5080 bpl here(NULL)es;if not end then loop
  510. 5090 formfeed lda #13
  511. 5100 jsr $ffd2
  512. 5110 inc line
  513. 5120 lda line
  514. 5130 cmp #69
  515. 5140 bcc formfeed
  516. 5150 lda #4
  517. 5160 jsr $ffc3:dec 154
  518. 5170 rts
  519. 5180 openptr lda #4; file